#include <stdio.h>
int a[4] = {1,2,3,4};
void func(int i, int sum);

int main()
{
//int a[4] = {1,2,3,4};
int i, sum = 0;
scanf("%d", &i);
/*for(;i <= 3; i++)
{
 sum += a[i];
 printf("%d %d\n",i, sum);
}*/

func(i, sum);

return 0;

}

void func(int i, int sum)
{
 
if(i <= 3)
{
 sum += a[i];
 printf("%d %d\n",i, sum);

}

sum+= a[i];
printf("%d\n", sum);
}
